#include "../include/CandidateResult.h"


bool operator < (const CandidateResult& lhs, const CandidateResult& rhs)
{
    if(lhs._dist < rhs._dist)
    {
        return true;
    }
    else if(lhs._dist == rhs._dist)
    {
        if(lhs._freq > rhs._freq)
        {
            return true;
        }
        else if(lhs._freq == lhs._freq)
        {
            return lhs._word <  rhs._word;
        }
        else
        {
            return false;
        }       
    }
    else
    {
        return false;
    }
}
